export function suffixType(filename) {
	let suffix = "";
  let result = "";
  try {
    let arr = filename.split(".");
    suffix = arr[arr.length - 1];
  } catch(err) {
    suffix = "";
  }
  if(!suffix) return result = false;
  // 图片格式
	let imgList = ["png", "jpg", "jpeg", "bmp", "gif", "wmf",'psd'];
  // 进行图片匹配
  result = imgList.some(item=>{
    return item == suffix.toLowerCase();
  })
  if(result) return result = "image";

  // 文本格式
	let txtList = ["txt"];
	//进行文本匹配
	result = txtList.some((item) => {
		return item == suffix.toLowerCase();
	})
  if(result) return result = "txt";

  // pdf格式
	let pdfList = ["pdf"]
	//进行pdf匹配
	result = pdfList.some((item) => {
		return item == suffix.toLowerCase();
	})
  if(result) return result = "pdf";

  // word格式
	let wordList = ["doc","docx"]
	//进行word匹配
	result = wordList.some((item) => {
		return item == suffix.toLowerCase();
	})
  if(result) return result = "word";

  // excel格式
	let excelList = ["xls","xlsx"]
	//进行excel匹配
	result = excelList.some((item) => {
		return item == suffix.toLowerCase();
	})
  if(result) return result = "xlsx";

  // video格式
	let videoList = ["mp4",'avi','3gp','flv','wmv','asf','mpeg','m4v','mov','f4v','rmvb','rm','vob']
	//进行video匹配
	result = videoList.some((item) => {
		return item == suffix.toLowerCase();
	})
  if(result) return result = "mp4";

  // voice格式
	let voiceList = ["mp3"]
	//进行voice匹配
	result = voiceList.some((item) => {
		return item == suffix.toLowerCase();
	})
  if(result) return result = "mp3";

  // 压缩包格式
	let zipList = ["zip",'rar','gz','tgz','bz2','z','tar']
	//进行压缩包匹配
	result = zipList.some((item) => {
		return item == suffix.toLowerCase();
	})
  if(result) return result = "zip";

  return result;
}